package com.ccp.dev.system.model;

import com.ccp.dev.core.basic.model.BaseModel;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * SYS_USER_POS Model对象
 * @author y
 */
public class UserPosition extends BaseModel {
	/**
	 * 是否主要岗位(0否,1是)
	 */
	public final static short PRIMARY_YES=1;
	public final static short PRIMARY_NO=0;
	
	/**
	 * 是否负责人(0否,1是)
	 */
	public final static Short CHARRGE_YES=1;
	public final static Short CHARRGE_NO=0;
	
	/**
	 * 是否删除(0否,1是)
	 */
	public final static Short DELETE_YES=1;
	public final static Short DELETE_NO=0;
	
	/**
	 * 是否组织管理员（0，否，1是)
	 */
	public final static Short IS_GRADE_MANAGE=1;
	public final static Short IS_NOT_GRADE_MANAGE=0;

	/**
	 * 中间表id
	 */
	protected String  userPosId;

	/**
	 * 岗位id
	 */
	protected String  posId;
	/**
	 * 组织ID
	 */
	protected String orgId;
	/**
	 * 用户id
	 */
	protected String userId;
	/**
	 * 职务id
	 */
	protected String  jobId;
	/**
	 * ISDELETE 默认值0
	 */
	protected Short  isDelete=DELETE_NO;
	/**
	 * 是否为主要
	 */
	protected Short isPrimary=PRIMARY_NO;
	/**
	 * 组织负责人
	 */
	protected Short isCharge=CHARRGE_NO;

	/**
	 * 用户名称
	 */
	protected String userName;
	/**
	 * 帐号
	 */
	protected String account;
	/**
	 * 单位名称
	 */
	protected String orgName;
	/**
	 * 岗位名称
	 */
	protected String posName;

	/**
	 * 职务名称
	 */
	protected String jobName;

	/**
	 * 公司名称
	 */
	protected String company;

	/**
	 * 公司id
	 */
	protected String companyId;
	/**
	 * 排序
	 */
	protected Integer sortNumber;

	/**
	 * 负责人
	 */
	protected String chargeName="";

	/**
	 * 是否分级授权管理员。
	 */
	protected Short isGradeManage=0;

	/**
	 * 是否在线0：非在线；1：在线
	 */
	private Short isOnline;

	public String getUserPosId() {
		return userPosId;
	}

	public void setUserPosId(String userPosId) {
		this.userPosId = userPosId;
	}

	public String getPosId() {
		return posId;
	}

	public void setPosId(String posId) {
		this.posId = posId;
	}

	public String getOrgId() {
		return orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getJobId() {
		return jobId;
	}

	public void setJobId(String jobId) {
		this.jobId = jobId;
	}

	public Short getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(Short isDelete) {
		this.isDelete = isDelete;
	}

	public Short getIsPrimary() {
		return isPrimary;
	}

	public void setIsPrimary(Short isPrimary) {
		this.isPrimary = isPrimary;
	}

	public Short getIsCharge() {
		return isCharge;
	}

	public void setIsCharge(Short isCharge) {
		this.isCharge = isCharge;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getOrgName() {
		return orgName;
	}

	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}

	public String getPosName() {
		return posName;
	}

	public void setPosName(String posName) {
		this.posName = posName;
	}

	public String getJobName() {
		return jobName;
	}

	public void setJobName(String jobName) {
		this.jobName = jobName;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getCompanyId() {
		return companyId;
	}

	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}

	public Integer getSortNumber() {
		return sortNumber;
	}

	public void setSortNumber(Integer sortNumber) {
		this.sortNumber = sortNumber;
	}

	public String getChargeName() {
		return chargeName;
	}

	public void setChargeName(String chargeName) {
		this.chargeName = chargeName;
	}

	public Short getIsGradeManage() {
		return isGradeManage;
	}

	public void setIsGradeManage(Short isGradeManage) {
		this.isGradeManage = isGradeManage;
	}

	public Short getIsOnline() {
		return isOnline;
	}

	public void setIsOnline(Short isOnline) {
		this.isOnline = isOnline;
	}

	/**
	 * @see Object#equals(Object)
	 */
	@Override
	public boolean equals(Object object)
	{
		if (!(object instanceof UserPosition))
		{
			return false;
		}
		UserPosition rhs = (UserPosition) object;
		return new EqualsBuilder()
		.append(this.userPosId, rhs.userPosId)
		.append(this.orgId, rhs.orgId)
		.append(this.posId, rhs.posId)
		.append(this.userId, rhs.userId)
		.append(this.isPrimary, rhs.isPrimary)
		.append(this.isCharge, rhs.isCharge)
		.append(this.isDelete, rhs.isDelete)
		.isEquals();
	}

	/**
	 * @see Object#hashCode()
	 */
	@Override
	public int hashCode()
	{
		return new HashCodeBuilder(-82280557, -700257973)
		.append(this.userPosId)
		.append(this.orgId)
		.append(this.posId)
		.append(this.userId)
		.append(this.isPrimary)
		.append(this.isCharge)
		.append(this.isDelete)
		.toHashCode();
	}

	/**
	 * @see Object#toString()
	 */
	@Override
	public String toString() 
	{
		return new ToStringBuilder(this)
		.append("userposId", this.userPosId) 
		.append("orgId", this.orgId)
		.append("posId", this.posId)
		.append("userId", this.userId)
		.append("isPrimary", this.isPrimary)
		.append("isCharge", this.isCharge)
		.append("isDelete", this.isDelete)
		.toString();
	}
   
  

}